//
//  tabletestAppDelegate.h
//  tabletest
//
//  Created by Andy on 2010/8/25.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "CustomUISplitViewController.h"
#import "StockGrapth.h"
#import "StockTableController.h" 
#import <MediaPlayer/MediaPlayer.h>
#import "HelpViewController.h"
#import "ASIFormDataRequest.h"
#import "TreemapView.h"


@class viewcontroller;
@class CDBViewController;
@class navcontroller;
@class Setup;
@class InAppPurchase;
@class RootViewController;
@class SplitViewDelegate;

@interface AppDelegate : NSObject <UIApplicationDelegate,UITabBarControllerDelegate , UINavigationControllerDelegate > {
	
    //紀錄目前裝置方向
    NSString *interfaceOrientation_ipad;
    
    //走勢圖物件
	StockGrapth * agraph;    
   
    HelpViewController *ahelp;
    
    UIWindow *window;
	
    UITabBarController  *aTabBarController;
	
    //用來記錄標籤的順序改變
	NSString *filePath; // Tab 檔案名稱與路徑
	NSString *filename;	// Tab 檔案名稱
	
	NSMutableArray *ArrayNavcontroller_object;
	NSMutableArray *ArrayNavcontroller_title;	
    
    //分割畫面使用物件
    CustomUISplitViewController *Split_viewController;	
    SplitViewDelegate* splitViewDelegate;    
   
    //儲存分割畫面的次視圖
    UIViewController *mv; //主視圖
    UIViewController *dv; //次視圖
    
    UIPopoverController* Master_popController;  
    UIPopoverController* popController_info;   
    UIPopoverController* popController_info_next; 
    
    navcontroller *pre_tablecontroller;
    
    UIViewController *pre_navigationController;
     
    //標記:tabBarController 暫停使用    
    BOOL tabBarController_isEnable; //主要是用來避免當機
    
    NSString *can_use_graph_setup;
    
    //標記:程式啓動後 必須先決定的重要參數 4 宣告
    //開始時從網路上取下重要的參數值
    NSString *p_datasource;
    NSString *p_status;
    NSString *p_user_grade;      
    NSString *p_login_count;
    NSString *p_displayname;
    NSString *p_firstentry_Date;      
    NSString *p_iap_type;   
    NSString *p_expire_datetime_unix;     
}


-(void)init_para;
-(void)init_tab;
-(void)Comm_iphone_ipad;

-(void)Get_interfaceOrientation:(NSString *)Orientation;
-(void)Get_agraph:(StockGrapth *)astockgraph;
-(void)Get_popController_info:(UIPopoverController *)get_popController_info;
-(void)Get_popController_info_next:(UIPopoverController *)get_popController_info_next;
 
//標記:tabBarController 暫停使用
-(void)Set_tabBarController_Enable;
-(void)Set_tabBarController_DisEnable;

/*
//標記:tabBarController 暫停使用
-(void)sc;
-(void)bc;
*/

-(void)record_login;

-(void)request_Finish:(ASIHTTPRequest *)request ;
-(void)request_Fail:(ASIHTTPRequest *)request ;
-(NSMutableArray *)Google_HistoryData_Daily:(NSString *)symbols 
                                        StartDates:(NSString *)ST
                                          EndDates:(NSString *)ED;

-(NSMutableArray *)Google_HistoryData:(NSMutableArray *)google_data 
                               Symbol:(NSString *)symbol_s 
                            StartDate:(NSString *)StartDate_s 
                              EndDate:(NSString *)EndDate_s 
                                  num:(int)num_i 
                                start:(int) start_i ;


@property(nonatomic, assign)  UIPopoverController * Master_popController; 
@property(nonatomic, assign)  UIPopoverController * popController_info; 
@property(nonatomic, assign)  UIPopoverController * popController_info_next; 
@property(nonatomic, assign)  CustomUISplitViewController *Split_viewController;
@property(nonatomic, assign)  SplitViewDelegate* splitViewDelegate;
@property(nonatomic, assign)  UIViewController *mv;
@property(nonatomic, assign)  UIViewController *dv;
@property(nonatomic, assign)  NSString *interfaceOrientation_ipad;
@property(nonatomic, assign)  StockGrapth *agraph;
@property(nonatomic, assign)  HelpViewController *ahelp;
@property(nonatomic, assign)  NSString *can_use_graph_setup;

@end

